home *** CD-ROM | disk | FTP | other *** search
/ Delphi 2.0 - Programmer's Utilities Power Pack / Delphi 2.0 Programmer's Utilities Power Pack.iso / a_to_d / dwsock11 / readme.txt < prev    next >
Encoding:
Text File  |  1996-09-15  |  3.7 KB  |  115 lines

  1. DWINSOCK V1.0
  2. -------------
  3.  
  4. A Windows Socket interface component for use with Borland Delphi.
  5.  
  6. By Ulf S÷derberg
  7. ulfs@sysinno.se
  8.  
  9. This is a short description of the DWinSock component for Borland Delphi
  10. that is contained in the file DWINSOCK.ZIP.
  11.  
  12. I am going to create a Delphi installable help file sometime soon.
  13. For now, you have to rely on this description and on the contents of the
  14. source files.
  15.  
  16. FILE CONTENTS
  17. -------------
  18. Files that originally came from PASOCK10.ZIP that has been changed by me:
  19. WINSOCK.INC    Part of the old WINSOCK.PAS (included in DWINSOCK.PAS)
  20. WINSOCK.IF    Part of the old WINSOCK.PAS (included in DWINSOCK.PAS)
  21. WINSOCK.IMP    Part of the old WINSOCK.PAS (included in DWINSOCK.PAS)
  22. ERROR.INC    Part of the old WINSOCK.PAS (included in DWINSOCK.PAS)
  23.  
  24. Original work by myself:
  25. DWINSOCK.RES    Contains two bitmaps for the controls, just blank bitmaps now.
  26. DWINSOCK.DCR    Contains two component palette bitmaps (very Q&D).
  27. DWINSOCK.PAS    The source code of the component.
  28. DWINSOCK.DCU    The compiled unit.
  29.  
  30. THE COMPONENTS IN DWINSOCK
  31. --------------------------
  32. DWinSock contains two components which I have named TClientSocket and
  33. TServerSocket. As the names implies, they are to be used in client or
  34. server applications.
  35.  
  36. TClientSocket Properties
  37.     Host        name of remote host, a string
  38.     Address        address of remote host, a string like '127.0.0.1'
  39.     Port        port number, an integer
  40.     Service        name of port, a string
  41.     Conn        current TSocket
  42.     Description    name of underlying WinSock
  43.     Text        send or receive a string
  44.     BytesSent    get number of bytes sent after last assign to Text
  45.  
  46. TClientSocket Methods
  47.     LocalHost    name of yourself
  48.     Reverse        reverse lookup an address
  49.     Open        do a connect
  50.     Close        the opposite
  51.     SendBuf        send a buffer
  52.     RecvBuf        receive a buffer
  53.     
  54. TClientSocket Events
  55.     OnInfo        progress indication
  56.     OnConnect
  57.     OnDisconnect
  58.     OnRead        incoming data
  59.     OnWrite        out buffer empty
  60.  
  61.  
  62. TServerSocket Properties
  63.     Port        port number, an integer
  64.     Service        name of port, a string
  65.     Conn        current TSocket
  66.     Description    name of underlying WinSock
  67.     Client        default array prop. to get TSocket of a connected client
  68.  
  69. TServerSocket Methods
  70.     LocalHost    name of yourself
  71.     Reverse        reverse lookup an address
  72.     Listen        listen for incoming connections
  73.     Close        the opposite
  74.     SendBuf        send a buffer
  75.     RecvBuf        receive a buffer
  76.  
  77. TServerSocket Events
  78.     OnInfo        progress indication
  79.     OnAccept    incoming connection accepted
  80.     OnDisconnect    connection closed
  81.     OnRead        incoming data
  82.     OnWrite        outuf empty
  83.  
  84. OTHER OBJECTS
  85. -------------
  86. Both TClientSocket and TServerSocket uses an object called TSocket which contains
  87. the connection status like ip address and port number. TSocket has several
  88. methods that you may call, they are:
  89.  
  90.     LookupName    convert a host name to an IP address.
  91.     LookupService    convert a service name to a port number.
  92.     LocalAddress    return your address for a connection.
  93.     LocalPort    return your port number for a connection.
  94.     RemoteHost    return the remote host name.
  95.     RemoteAddress    return the remote IP address.
  96.     RemotePort    return the remote port number.
  97.  
  98. EXCEPTIONS
  99. ----------
  100. If anything goes wrong inside you will get an exception of type ESockError with
  101. a message indicating what kind of error that cause the exception.
  102.  
  103. SUMMARY
  104. -------
  105. This was a very brief description of DWINSOCK. As you can see from the source
  106. files it does not at all use all functions of Windows Sockets but it may
  107. provide a quick solution to get into WinSock programming with Delphi.
  108.  
  109. I have included a sample application called NETTIME that is a time client.
  110. It gets the current time of day from a time server.
  111.  
  112. You may use DWINSOCK any way you like but don't blame me.
  113.  
  114. Suggestions may be emailed to ulfs@sysinno.se
  115.